package vsy.buzzwordbingo.util;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.HttpStatus;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;

public class ControllerUtil {
	public static ModelAndView createEmptyResponse(final String contentType, final HttpStatus status) {
		return new ModelAndView(new View() {
			
			@Override
			public String getContentType() {
				return contentType;
			}

			@Override
			public void render(Map<String, ?> model,
					HttpServletRequest request, HttpServletResponse response)
					throws Exception {
				response.setStatus(status.value());
			}
		});
	}
}
